﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Graphing
{
    public class Point : IComparable 
    {
        public double x { get; set; }
        public double y { get; set; }
        public double z { get; set; }
        public String PointsDisplayFormat
        {
            get
            {
                if (z != null)
                    return String.Format("{0}, {1}, {2}", x.ToString(), y.ToString(), z.ToString());
                else
                    return String.Format("{0}, {1}", x.ToString(), y.ToString());
            }
        }

        #region Sort

        public int CompareTo(object rhs)
        {
            Point temp = (Point)rhs;

            if (this.x > temp.x)
                return 1;
            if (this.x < temp.x)
                return -1;

            return 0;

        }

        #endregion // Sort.
    }
}
